import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { parkPlaceVO, parkPlaceForm, parkPlaceQuery } from '@/api/park/park-building-floor/types';

/**
 * 查询园区区域列表
 * @param query
 * @returns {*}
 */

export const listparkBuildingFloor = (query?: parkPlaceQuery): AxiosPromise<parkPlaceVO[]> => {
  return request({
    url: '/park/park-building-floor/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询园区区域详细
 * @param parkPlaceId
 */
export const getparkBuildingFloor = (parkPlaceId: string | number): AxiosPromise<parkPlaceVO> => {
  return request({
    url: '/park/park-building-floor/' + parkPlaceId,
    method: 'get'
  });
};

/**
 * 新增园区区域
 * @param data
 */
export const addparkBuildingFloor = (data: parkPlaceForm) => {
  return request({
    url: '/park/park-building-floor',
    method: 'post',
    data: data
  });
};

/**
 * 修改园区区域
 * @param data
 */
export const updateparkBuildingFloor = (data: parkPlaceForm) => {
  return request({
    url: '/park/park-building-floor',
    method: 'put',
    data: data
  });
};

/**
 * 删除园区区域
 * @param parkPlaceId
 */
export const delparkBuildingFloor = (parkPlaceId: string | number | Array<string | number>) => {
  return request({
    url: '/park/park-building-floor/' + parkPlaceId,
    method: 'delete'
  });
};
